package com.helen.ui.account;

import com.helen.db.UserHelper;
import com.helen.global.Constants;
import com.helen.shopping.R;
import com.helen.ui.BaseActivity;
import com.helen.utils.MyLog;
import com.helen.utils.tiputils.MToast;
import com.zhouyou.http.EasyHttp;
import com.zhouyou.http.callback.SimpleCallBack;
import com.zhouyou.http.exception.ApiException;
import com.zhouyou.http.model.HttpParams;

/**
 * Created by yang on 2018/7/9.
 * 金宝余额详情
 */

public class MoneyDetailActivity extends BaseActivity{
    private int iid;

    @Override
    protected int attachLayoutRes() {
        return R.layout.activity_money_detail;
    }

    @Override
    protected void initInjector() {

    }

    @Override
    protected void initViews() {
        iid = getIntent().getIntExtra("iid",0);
        getToolbarTitle().setText("详情");
        moneyDetailApi();
    }

    @Override
    protected void updateViews() {

    }

    private void moneyDetailApi(){
        mMProgressDialog.show();
        HttpParams params = new HttpParams();
        params.put("id", UserHelper.getInstance().getloginEntity(MoneyDetailActivity.this).getId()+"");
        params.put("iid",iid+"");
        EasyHttp.post(Constants.API_JSONAPI_MONEYDETAIL)
                .params(params)
                .execute(new SimpleCallBack<String>() {
                    @Override
                    public void onCompleted() {
                        super.onCompleted();
                        mMProgressDialog.dismiss();
                    }

                    @Override
                    public void onError(ApiException e) {
                        MyLog.d(TAG, "获取金宝余额详情失败==" + e.toString());
                        MToast.makeTextShort(MoneyDetailActivity.this, getString(R.string.service_error)).show();
                    }

                    @Override
                    public void onSuccess(String result) {
                        MyLog.e("yang", "result==" +result);
                    }
                });
    }
}
